home *** CD-ROM | disk | FTP | other *** search
- program PExample;
-
- uses
- {$ifc undefined THINK_Pascal}
- Types, Files, Packages, Aliases,
- {$endc}
- ICTypes, ICAPI, ICKeys;
-
- var
- inst: ICInstance;
-
- procedure DumpPrefs;
- var
- count: longint;
- i: longint;
- key: Str255;
- begin
- writeln('ICCountPref: ', ICCountPref(inst, count) : 1);
- for i := 1 to count do begin
- write(' ICGetIndPref: ', ICGetIndPref(inst, i, key) : 1, ' - ');
- writeln(key);
- end; (* for *)
- end; (* DumpPrefs *)
-
- var
- folder_spec: ICDirSpecArray;
- email_address: Str255;
- attr: longint;
- size: longint;
- seed: longint;
- mappings: handle;
- entry: ICMapEntry;
- begin
- {$ifc not undefined THINK_Pascal}
- ShowText;
- {$endc}
- writeln('ICStart: ', ICStart(inst, 'CREA') : 1); (* tell it your application creator *)
- folder_spec[0].vRefNum := -1; (* search for prefs in root of the system *)
- folder_spec[0].dirID := 2; (* volume, obviously you'd use other things *)
- writeln('ICFindConfigFile: ', ICFindConfigFile(inst, 1, @folder_spec) : 1);
-
- writeln('ICBegin: ', ICBegin(inst, icReadWritePerm) : 1);
- size := sizeof(email_address);
- writeln('ICGetPref: ', ICGetPref(inst, kICEmail, attr, @email_address, size) : 1);
- writeln('Your Email address is ', email_address);
-
- DumpPrefs;
- writeln('ICEnd: ', ICEnd(inst) : 1);
-
- writeln('ICGetSeed: ', ICGetSeed(inst, seed) : 1, ' = ', seed : 1);
- (* now monitor this seed to see if any preferences have changed *)
-
- writeln('ICStop: ', ICStop(inst));
- end. (* PExample *)